Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct System.​Memory`1

Assembly: System.Runtime

Represents a contiguous region of memory.

Properties

public bool
IsEmpty
Indicates whether the current instance is empty.
public int
Length
Gets the number of items in the current instance.
public Span`1
Span
Returns a span from the current instance.

Methods

public void
CopyTo​(Memory`1 destination)
public bool
Equals​(Memory`1 other)
public bool
Equals​(object obj)
obj The object to compare with the current instance.
Returns <see langword="true" /> if the current instance and <paramref name="obj" /> are equal; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to the current object.
public int
GetHashCode​()
Returns A 32-bit signed integer hash code.
Returns the hash code for this instance.
public MemoryHandle
Pin​()
Returns A handle for the <see cref="T:System.Memory`1" /> object.
Creates a handle for the <see cref="T:System.Memory`1" /> object.
public Memory`1
Slice​(int start)
start The index at which to begin the slice.
Returns An object that contains all elements of the current instance from <paramref name="start" /> to the end of the instance.
Forms a slice out of the current memory that begins at a specified index.
public Memory`1
Slice​(int start, int length)
start The index at which to begin the slice.
length The number of elements to include in the slice.
Returns An object that contains <paramref name="length" /> elements from the current instance starting at <paramref name="start" /> .
Forms a slice out of the current memory starting at a specified index for a specified length.
public T[]
ToArray​()
Returns An array containing the elements in the current memory.
Copies the contents from the memory into a new array.
public string
ToString​()
Returns the string representation of this <see cref="T:System.Memory`1" /> object.
Returns the string representation of this <see cref="T:System.Memory`1" /> object.
public bool
TryCopyTo​(Memory`1 destination)
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates a shallow copy of the current <see cref="T:System.Object" /> .